package com.aos.iot.socket.udp.runner;

import com.aos.iot.socket.udp.SocketUdpServer;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

@RequiredArgsConstructor
public class SocketUdpRunner implements ApplicationRunner {

    private final SocketUdpServer socketUdpServer;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        socketUdpServer.start();
    }

    public void stop() {
        socketUdpServer.stop();
    }
}
